home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / ply15dat.zip / WHIRL.PI < prev    next >
Text File  |  1992-09-19  |  4KB  |  142 lines

  1. //
  2. // Demonstration of a whirling spheres
  3. //
  4. // Polyray input file - Alexander Enzmann
  5. //
  6.  
  7. // Define the range of the animation
  8. start_frame  0
  9. end_frame    119
  10. total_frames 120
  11. outfile whirl
  12.  
  13. // Set up the camera
  14. viewpoint {
  15.    from <0,3,-20>
  16.    at <0,0,0>
  17.    up <0,1,0>
  18.    angle 45
  19.    resolution 160, 160
  20.    }
  21.  
  22. // Set up background color & lights
  23. background skyblue
  24. //light <-10,20,-50>
  25. light < 10,20,-50>
  26.  
  27. include "..\..\colors.inc"
  28.  
  29. // Give the (time dependent) location of the sphere points
  30. define ang radians(6 * frame)
  31.  
  32. define r10 1
  33. define r11 1
  34. define r20 2
  35. define r21 1
  36. define r30 2
  37. define r31 3
  38. define r40 3
  39. define r41 4
  40. define r50 4
  41. define r51 1
  42. define r60 1
  43. define r61 3
  44. define r70 2
  45. define r71 2
  46. define r80 3
  47. define r81 5
  48.  
  49. define s1 3
  50. define s2 2
  51. define s3 1.5
  52. define s4 1
  53. define s5 3
  54. define s6 2
  55. define s7 1.5
  56. define s8 1
  57. define s09 2
  58. define s10 1.5
  59. define s11 3
  60. define s12 1.5
  61. define s13 2
  62. define s14 3
  63. define s15 2
  64. define s16 1.5
  65. define s17 1
  66.  
  67. define r09x 3
  68. define r09y 2
  69. define r09z 1
  70. define r10x 1
  71. define r10y 2
  72. define r10z 1
  73. define r11x 2
  74. define r11y 0.5
  75. define r11z 3
  76. define r12x 5
  77. define r12y 0
  78. define r12z 0
  79. define r13x 3
  80. define r13y 3
  81. define r13z 3
  82. define r14x 4
  83. define r14y 0
  84. define r14z 1
  85. define r15x 0
  86. define r15y 0
  87. define r15z 4
  88. define r16x 0
  89. define r16y 3
  90. define r16z 0.5
  91.  
  92. define o09 radians(0)
  93. define o10 radians(192)
  94. define o11 radians(15)
  95. define o12 radians(20)
  96. define o13 radians(117)
  97. define o14 radians(300)
  98. define o15 radians(270)
  99. define o16 radians(90)
  100.  
  101. // Define the positions of the various spheres
  102. define loc1 < r10 * cos(s1*ang), 0, r11 * sin(s1*ang)>
  103. define loc2 < r20 * cos(s2*ang), 0, r21 * sin(s2*ang)>
  104. define loc3 < r30 * cos(s3*ang), 0, r31 * sin(s3*ang)>
  105. define loc4 < r40 * cos(s4*ang), 0, r41 * sin(s4*ang)>
  106. define loc5 < r50 * cos(s5*ang), r51 * sin(s5*ang), 0>
  107. define loc6 < r60 * cos(s6*ang), r61 * sin(s6*ang), 0>
  108. define loc7 < r70 * cos(s7*ang), r71 * sin(s7*ang), 0>
  109. define loc8 < r80 * cos(s8*ang), r81 * sin(s8*ang), 0>
  110.  
  111. define loc09 <r09x*cos(s09*ang+o09),r09y*cos(s09*ang+o09),r09z*cos(s09*ang+o09)>
  112. define loc10 <r10x*cos(s10*ang+o10),r10y*cos(s10*ang+o10),r10z*cos(s10*ang+o10)>
  113. define loc11 <r11x*cos(s11*ang+o11),r11y*cos(s11*ang+o11),r11z*cos(s11*ang+o12)>
  114. define loc12 <r12x*cos(s12*ang+o12),r12y*cos(s12*ang+o12),r12z*cos(s12*ang+o12)>
  115. define loc13 <r13x*cos(s13*ang+o13),r13y*cos(s13*ang+o13),r13z*cos(s13*ang+o13)>
  116. define loc14 <r14x*cos(s14*ang+o14),r14y*cos(s14*ang+o14),r14z*cos(s14*ang+o14)>
  117. define loc15 <r15x*cos(s15*ang+o15),r15y*cos(s15*ang+o15),r15z*cos(s15*ang+o15)>
  118. define loc16 <r16x*cos(s16*ang+o16),r16y*cos(s16*ang+o16),r16z*cos(s16*ang+o16)>
  119.  
  120. //
  121. // The following spheres make a set of whirling balls
  122. //
  123. // Note that by changing the center location of the spheres rather than
  124. // using a "translate" statement, the textures do not move with the spheres
  125. //
  126. object { sphere loc1, 0.5 shiny_red }
  127. object { sphere loc2, 0.5 shiny_blue }
  128. object { sphere loc3, 0.5 texture { checker matte_cyan, matte_magenta } }
  129. object { sphere loc4, 0.5 texture {hexagon matte_brown,matte_white,shiny_blue}}
  130. object { sphere loc5, 0.5 shiny_coral }
  131. object { sphere loc6, 0.5 texture { checker matte_red, matte_blue } }
  132. object { sphere loc7, 0.5 shiny_orange }
  133. object { sphere loc8, 0.5 matte_brown }
  134. object { sphere loc09, 0.5 shiny_red }
  135. object { sphere loc10, 0.5 texture {hexagon shiny_red,shiny_green,shiny_blue}}
  136. object { sphere loc11, 0.5 texture { checker shiny_coral, shiny_green } }
  137. object { sphere loc12, 0.5 shiny_green }
  138. object { sphere loc13, 0.5 shiny_coral }
  139. object { sphere loc14, 0.5 texture { checker matte_red, matte_blue } }
  140. object { sphere loc15, 0.5 shiny_orange }
  141. object { sphere loc16, 0.5 matte_brown }
  142.